<body>

<h1>Recent Snippets</h1>
<div class="yui-g">
         <div class="yui-u first">
			<ol class="recentsnippets">
				<% request.snippets.each { s -> %>
				
					<li>
						<a href="/snippet/${s.key.id}">${s.name}</a>
						<small class="snippetcreatedtime">
							posted <%=s.createdDate !=null ? new com.ocpsoft.pretty.time.PrettyTime().format(s.createdDate) : ""%> by <em class="snippetAuthorName"><%=s.author instanceof com.google.appengine.api.users.User ? s.author.nickname : "anonymous"%></em>
						</small>
						<!-- (<%=s.tags ? s.tags.size() : 0%>) -->	
					</li>
				
				<% } %>
			</ol>
         </div>
         <div class="yui-u">
			<% if (!user){ %>
				<a href="<%=users.createLoginURL("/")%>"><small>Login</a>
			<% } else { %>
				Hi, <%=user.nickname%> <a href="<%=users.createLogoutURL("/")%>"><small>Logout</a>
         	<% }%>
         </div>
</div>


</body>